<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Template - A CodeIgniter Library</title>
	<style type="text/css" media="all">@import url('./userguide.css');</style>
</head>

<body>

	<div id="header">
		<span class="lib-name">Template Library for CodeIgniter, the PHP Framework</span>
		<div id="search">
			<form action="http://www.google.com/search" method="get">
				<input type="hidden" value="williamsconcepts.com/codeigniter/libraries/template/" id="as_sitesearch" name="as_sitesearch"/>
				<label for="q">Search User Guide</label>
				<input type="text" value="" maxlength="255" size="31" id="q" name="q" style="width: 200px;" class="input"/> 
				<input type="submit" value="Go" name="sa" class="submit"/>
			</form>
		</div>
		<ul id="navigation">
			<li class="active"><a href="./index.html">Introduction</a></li>
			<li><a href="./start.html">Getting Started</a></li>
			<li><a href="./reference.html">User Guide</a></li>
			<li><a href="./download.html">Download Template Library</a></li>
         <li><a href="./discussion.html">Discussion</a></li>
		</ul>
	</div>
	
	<!-- START CONTENT -->
	<div id="content">
	
		<h1>Introduction to Template</h1>
		
		<p class="verified"><strong>Template has been verified to work with CodeIgniter 1.7</strong></p>
		
		<p>The Template library, written for the CodeIgniter PHP-framework, is a 
			wrapper for <abbr title="CodeIgniter">CI</abbr>’s View implementation. Template is a reaction to the 
			numerous questions from the CI community regarding how one would display 
			multiple views for one controller, and how to embed “views within views” 
			in a standardized fashion. In addition, Template provides extra Views loading capabilities, 
         the ability to utilize any template parser (like Smarty),
         and shortcuts for including CSS, JavaScript, and other common elements in your final
         rendered HTML.</p>
			
		<h2>Template is right for you if:</h2>
		<ul>
			<li>You feel like using views can be clunky, especially when "embedding" views.</li>
			<li>You don't like calling header, footer, and other global views from <em>every</em> 
            Controller method.</li>
			<li>You prefer having one "master template" that can be changed for any 
				controller in order to meet unique application design needs.</li>
			<li>You don't want to drastically alter the way you interface controllers and views.</li>
			<li>You like clear, thorough documentation on par with CodeIgniter's User Guide.</li>
		</ul>
		
		<p><strong>Ready to give Template a shot? <a href="./download.html">Download it</a> 
		now and <a href="./start.html">get started</a>.</strong></p>
		
      <h2>What's New in Version 1.4.1?</h2>
      <p>Version 1.4.1 is mostly a maintenance release, fixing comment and documentation typos.
         In addition, the 1.4.1 download now ships with its documentation. And finally, the Template class
         was renamed to work more like a core library so you can extend/overload/replace it in
         your application libraries folder, among other things.</p>
      
      <p><a href="./download.html">Download Version 1.4.1</a></p>
      
		<h2>Template's Approach</h2>
		<p>Template works by writing to pre-defined regions of a master template. Although you will
         most often write to your template from a Controller,
			you can write content to these regions from any part of your application. 
			Content could be a simple string of plain text, <abbr title="Hypertext Markup Language">HTML</abbr>, 
			or the results from a View. Regions display by echoing variables placed throughout your master 
			template as desired. Template also lets you use multiple template configurations, making it 
         completely flexible to meet the needs of your application’s design.</p>
      <p>Here's what using template looks like:</p>
      <code>$this-&gt;template-&gt;write('title', 'Introduction to Template');<br />
         $this-&gt;template-&gt;write_view('content', 'blog/posts', $this-&gt;blog-&gt;get_posts());<br />
         $this-&gt;template-&gt;render();</code>

		<p>Look interesting? Head over to the <a href="./start.html">Getting Started section</a> to 
			begin using Template in your next CodeIgniter application.</p>
		
		<h2>Template User Guide:</h2>
		
		<ul>
			<li><a href="./start.html">Getting Started</a></li>
			<li><a href="./reference.html">Template User Guide</a></li>
			<li><a href="./download.html">Download Template Library</a></li>
		</ul>
		
	</div>
	<!-- END CONTENT -->
	
	<div id="footer">
		<p>
		<a href="#">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
		<a href="./index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
		Next Topic:&nbsp;&nbsp;<a href="./start.html">Getting Started</a>
		</p>
		<p><a href="http://williamsconcepts.com">WillamsConcepts.com</a> &nbsp;&middot;&nbsp; Copyright &#169; 2008 &nbsp;&middot;&nbsp; Colin Williams</p>
		
	</div>
   
   <script type="text/javascript">
      var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
      document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
   </script>
   <script type="text/javascript">
      var pageTracker = _gat._getTracker("UA-1894650-2");
      pageTracker._trackPageview();
   </script>

</body>
</html>